package unit4.task4_2;

public class HireUserTest {
    //测试构造方法继承
    //通过无参数的构造方法创建对象
        System.out.print("通过无参数的构造方法创建对象！");
    //创建客户对象
    Customer1 customer1=new Customer1();
    //创建求租客户对象
    HireUser1 hireUser1=new HireUser1();

        System.out.print("*****************");
    //1.2创建带参数的构造方法创建对像
        System.out.print("通过带参数的构造方法创建对象！");
    Customer1 customer=new Customer1(1001,"张宇",'男',"684503805",
            "460261748","zy@qq.com","672650136","572070390836956",
            "四川省绵阳市江油市诗城路西段");
    //登记日期
    Data recordDate=new Date();
    HireUser1 hireUser1=new HireUser1(1001,"张宇",'男',"684503805",
            "460261748","zy@qq.com","672650136","572070390836956",
            "四川省绵阳市江油市诗城路西段","1001",recordDate);

        System.out.print("**************");
    //2对象类型转向
    //2.1 向上转向：父类引用子类对象
    Customer1 customer2=new HireUser1();

        customer2.setUserName("张辽");
        customer.showUserName();

        System.out.print("***************");
    //2.2向下转型：子类引用了父类的对象
    Customer1 customer3=new  HireUser1();
    hireUser1 hireUser3=(HireUser1)customer3;
        hireUser1.setUserName();
        hireUser1.showUserName();
     }
}
